package com.changcheng.project.yuminsi.enums;

/**
 * @author yuminsi
 * @description
 * @date 2020/8/21 10:30
 * @since
 */
public enum  VehicleColor {
    /**
     * 蓝
     */
    BLUE("蓝","0"),
    /**
     * 黄
     */
    YELLOW("黄","1"),
    /**
     * 黑
     */
    BLACK("黑","2"),
    /**
     * 白
     */
    WHITE("白","3"),
    /**
     * 渐变绿
     */
    GRADIENTGREEN("渐变绿","4"),
    /**
     * 黄绿双拼
     */
    YELLOWANDGREEN("黄绿双拼","5"),
    /**
     * 蓝白渐变
     */
    BLUEANDWHITEGRADIENT("蓝白渐变","6"),
    /**
     * 灰
     */
    GRAY("灰","14"),
    /**
     *青
     */
    GREEN("青","15"),
    /**
     *银
     */
    SILVER("银","16"),
    /**
     *红
     */
    REN("红","17"),
    /**
     * 棕
     */
    BROWN("棕","18"),
    /**
     *紫
     */
    PURPLE("紫","19");


    private String name;
    private String code;

    VehicleColor() {
    }

    VehicleColor(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static VehicleColor getVehicleColor(String code){
        for (VehicleColor color: values()){
            if (color.getCode().equals(code)){
                return color;
            }
        }
        return null;
    }
}
